﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes.sim {
    import flash.utils.*;
    import com.adobe.utils.*;

    public class BusinessVisitStorage {

        private var m_townies:Dictionary;
        private var m_tourists:Dictionary;

        public function BusinessVisitStorage(){
            this.clear();
        }
        public function clear():void{
            this.m_townies = new Dictionary();
            this.m_tourists = new Dictionary();
        }
        public function add(_arg1:Number, _arg2:Number, _arg3:Number):void{
            if (this.m_townies[_arg1] == null){
                this.m_townies[_arg1] = 0;
            };
            this.m_townies[_arg1] = (this.m_townies[_arg1] + _arg2);
            if (this.m_tourists[_arg1] == null){
                this.m_tourists[_arg1] = 0;
            };
            this.m_tourists[_arg1] = (this.m_tourists[_arg1] + _arg3);
        }
        public function getSortedKeys():Array{
            return (DictionaryUtil.getKeys(this.m_townies).sort(Array.NUMERIC));
        }
        public function getSortedTownies():Array{
            return (this.getSortedValues(this.m_townies));
        }
        public function getSortedTourists():Array{
            return (this.getSortedValues(this.m_tourists));
        }
        public function getSortedValues(_arg1:Dictionary):Array{
            var _local4:*;
            var _local2:Array = this.getSortedKeys();
            var _local3:Array = [];
            for each (_local4 in _local2) {
                _local3.push(_arg1[_local4]);
            };
            return (_local3);
        }

    }
}//package Classes.sim 
